<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<!-- <?php
$year = $_GET["year"];
if (isset($_GET["year"])) {
    if (is_numeric($year)) {
        if ($year % 100 == 0) { //判断世纪年
            if ($year % 400 == 0 && $year % 3200 != 0) {
                echo "世纪年" . $year . "是闰年!"; //世纪年里的闰年
            } else {
                echo "世纪年" . $year . "不是闰年!";
            }
        } else { //剩下的就是普通年了
            if ($year % 4 == 0 && $year % 100 != 0) {
                echo "普通年" . $year . "是闰年!"; //普通年里的闰年
            } else {
                echo "普通年" . $year . "不是闰年!";
            }
        }
    } else
        $msg = "请输入正确的格式";
}
?> -->

<!-- <link rel="stylesheet" href="year.php"> -->

<body>
    <form name=rn method='get'>
        <b>请输入年：</b>
        <input type="text" name=year>
        <input type="submit" name=sub value="查询">
        <?php
echo $msg;
?>
    </form>
</body>


</html>
<?php
    $year =$_GET["year"];
    if(isset($_GET[$year])){
            if($year%4==0 and $year%100==0 and $year%400!=0){
                echo '是闰年';
                $msg='是闰年';
            }else{
              echo '不是闰年';
              $msg='不是闰年';
            }
    }
    ?>